import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.border.AbstractBorder;

@SuppressWarnings("serial")
class TextFieldBorder extends AbstractBorder {

    RenderingHints hints;

    TextFieldBorder(Color color) {
    	//Postavljanje pravila
        hints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON);
    }

    @Override
    public void paintBorder(
        Component c,
        Graphics g,
        int x, int y,
        int width, int height) {
        Graphics2D g2 = (Graphics2D)g;
        
        //Crtanje okvira
        g2.setColor(new Color(200, 200, 200));
        g2.drawRoundRect(0, 0, width - 1 , height - 1, 10, 10);
        g2.setColor(new Color(237, 237, 237));
        g2.drawRoundRect(2, 2, width - 5 , height - 5, 10, 10);

        g2.setRenderingHints(hints);
    }
}
